package com.java.controller;

import com.java.common.utils.R;
import com.java.pojo.bo.ShopcartBO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author jl
 * Created on 2020/10/17
 */
@Api(tags = "购物车接口")
@RestController
@RequestMapping("/shopcart")
public class ShopCartController {

    @ApiOperation("添加商品到购物车")
    @PostMapping("/add")
    public R add(@RequestParam String userId, @RequestBody ShopcartBO shopcartBO, HttpServletRequest request, HttpServletResponse response) {
        System.out.println(shopcartBO);
        return R.ok();
    }

    @ApiOperation("从购物车中删除商品")
    @PostMapping("/del")
    public R del(@RequestParam String userId, @RequestParam String itemSpecId, HttpServletRequest request, HttpServletResponse response) {
        return R.ok();
    }
}
